function mode_agentclass(){
	
	var c={
		showagent:function(){
			if($('#leftshow3').html()==''){
				this.showagents(this.agentarr);
			}else{
			}
		},
		showagents:function(da){
			this.agentarr = da;
			var o1 = $('#leftshow3');
			o1.html('');
			var i,len=da.length,d,typarr={},str,i1,str1='';
			for(i=0;i<len;i++){
				if(!typarr[da[i].types])typarr[da[i].types]=[];
				typarr[da[i].types].push(da[i]);
			}
			for(i in typarr){
				d = typarr[i];
				str='<div style="padding:5px;color:#aaaaaa;border-bottom:1px rgba(0,0,0,0.05) solid">'+i+'('+d.length+')</div>';
				o1.append(str);
				for(i1=0;i1<d.length;i1++){
					this.showagentss(d[i1]);
				}
			}
	
			o1.append('<div align="center" style="padding:10px;"><a onclick="reim.agentreload(this)" style="font-size:12px;color:#bbbbbb"><i class="icon-refresh"></i> 刷新</a></div>');
		},
		showagentss:function(d){
			var num = 'agent_'+d.num+'';
			$('#lists_'+num+'').remove();
			var hei = 26;
			var s	= '<div class="lists" onclick="reim.openagent('+d.id+')" id="lists_'+num+'" >';
			s+='<table cellpadding="0" border="0" width="100%"><tr>';
			s+='<td style="padding-right:8px"><div style="height:'+hei+'px;overflow:hidden"><img style="height:'+hei+'px;width:'+hei+'px" src="'+d.face+'"></div></td>';
			s+='<td align="left" width="100%"><div class="name"><font>'+d.name+'</font></div></td>';
			s+='<td align="right" nowrap>&nbsp;</td>';
			s+='</tr></table>';
			s+='</div>';
			
			$('#leftshow3').append(s);
		},
		agentinfo(id){
			var a = this.agentarr;
			var i,len=a.length,d=false;
			for(i=0;i<len;i++){
				if(a[i].id==id){
					d=a[i];
					break;
				}
			}
			return d;
		},
		agenturl:function(oi){
			var d = this.agentinfo(oi);
			if(!d)return;
			if(d.url){this.openurl(d.url,1);return;}
			if(d.murl){this.openurl(d.murl,1,1);return;}
		},
		openagent:function(oi,opb){
			var d = this.agentinfo(oi);
			if(!d)return;
			if(d.iszy=='1'){
				if(d.url){this.openurl(d.url,1);return;}
				if(d.murl){this.openurl(d.murl,1,1);return;}
			}
			var num = 'agent'+d.id+'';
			var da  = this.historysdata[num];
			if(!da){
				da={
					'type':'agent',
					'num' : num,
					'id':d.id,
					name:d.name,
					face:d.face,
					receid:d.receid,
					stotal:0,
					cont:'',
					optdt:js.serverdt()
				}
				this.showhistorys(da,true);
			}
			this.showchat(num);
			this.changleft(0);
			return;
			if(isempt(d.url) || opb){
			}else{
				this.openurl(d.url,1);
			}
		},
		agentreload:function(o1){
			if(o1)o1.innerHTML='<img src="images/loading.gif">';
			this.ajax('reim,getagent',false,function(ret){
				reim.showagents(ret.data.agentarr);
			});
		}
	}
	
	js.importjs('res/js/jquery-changeuser.js');
	reim.loadclass('mode_search');
	
	return c;
}